/* GUI CONVERTED from sotriq04.p (converter v1.75) Fri Feb  2 01:27:27 2001 */
/* sotriq04.p - SALES ORDER SHIPMENT HISTORY BY PART                    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert sotriq04.p (converter v1.00) Thu Feb 26 10:43:50 1998 */
/* web tag in sotriq04.p (converter v1.00) Thu Feb 26 10:43:33 1998 */
/*F0PN*/ /*K1JV*/ /*                                                    */
/*V8:ConvertMode=Report                                        */
/* REVISION: 1.0      LAST MODIFIED: 04/11/86   BY: PML      */
/* REVISION: 2.0      LAST MODIFIED: 08/04/87   BY: emb *A79**/
/* REVISION: 2.1      LAST MODIFIED: 08/27/87   BY: WUG *A94**/
/* REVISION: 2.1      LAST MODIFIED: 01/02/88   BY: pml remove A94 */
/* REVISION: 4.0      LAST EDIT: 12/30/87   BY: WUG *A137* */
/* REVISION: 4.0      LAST MODIFIED: 04/18/88   BY: FLM add  A94  */
/* REVISION: 4.0      LAST MODIFIED: 05/03/88   BY: flm *A224*/
/* REVISION: 5.0      LAST MODIFIED: 03/20/89   BY: MLB *B069*/
/* REVISION: 5.0      LAST EDIT: 05/03/89    BY: WUG *B098* */
/* REVISION: 5.0      LAST MODIFIED: 01/19/90   BY: ftb *B514*/
/* Revision: 7.3    Last edit: 11/19/92     By: jcd *G345* */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 02/26/98   BY: *K1JV* Beena Mol    */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan   */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KN* myb              */
/* REVISION: 9.1      LAST MODIFIED: 10/16/00   BY: *N0WC* Mudit Mehta      */

/*K1JV*/ /* DISPLAY TITLE */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K1JV*/ {mfdtitle.i "b+ "}
/*N0WC*/ {cxcustom.i "SOTRIQ04.P"}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE sotriq04_p_1 "Qty Shipped"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define variable part like tr_part.
define variable addr like so_cust.
define variable ord like so_nbr.
/*B514*/ define variable eff_date like tr_effdate.

/*K1JV* /* DISPLAY TITLE */
 * {mfdtitle.i "b+ "} */

part = global_part.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   part
   addr
   ord
/*B514*/ eff_date
with frame a no-underline width 80 attr-space THREE-D /*GUI*/.

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/*K1JV*/ {wbrp01.i}

repeat with frame a:

/*K1JV*/ if c-application-mode <> 'web' then
   update part addr ord
/*B514*/ eff_date
   with frame a editing:

      if frame-field = "part" then do:
     /* FIND NEXT/PREVIOUS RECORD */
     {mfnp.i pt_mstr part pt_part part pt_part pt_part}
     if recno <> ? then do:
        part = pt_part.
        display part with frame a.
     end.
      end.
      else do:
     status input.
     readkey.
     apply lastkey.
      end.
   end.

/*K1JV*/ {wbrp06.i &command = update &fields = "  part addr ord  eff_date"
          &frm = "a"}

/*K1JV*/ if (c-application-mode <> 'web') or
/*K1JV*/ (c-application-mode = 'web' and
/*K1JV*/ (c-web-request begins 'data')) then do:

   hide frame b.
   hide frame c.
   hide frame d.
   hide frame e.

/*K1JV*/ end.

   /* SELECT PRINTER */
   {mfselprt.i "terminal" 80}


   {hksimsg.i """" """"}

   if part <> "" then repeat for tr_hist
      with frame b width 80 no-attr-space:

        /* SET EXTERNAL LABELS */
        setFrameLabels(frame b:handle).
        
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                 /*G345*/
      find prev tr_hist where tr_part = part AND LOOKUP(tr_site,GLOBAL_user_site) > 0
        no-lock use-index tr_part_eff.

/*N0WC*/ {&SOTRIQ04-P-TAG1}
      if (tr_type = "ISS-SO" or tr_type = "RCT-SOR" OR tr_type = "ISS-CSR" )    /*added by fdn*/
      and (tr_addr = addr or addr = "" ) and (tr_nbr = ord or ord = "" )
      and (tr_effdate = eff_date or eff_date = ?) then
/*N0WC*/ {&SOTRIQ04-P-TAG2}
      display tr_trnbr tr_date tr_effdate tr_ship_type
      tr_addr tr_nbr format "x(8)" tr_rmks format "X(8)"
      (- tr_qty_loc) @ tr_qty_loc label {&sotriq04_p_1} WITH STREAM-IO /*GUI*/ .
   end.

   else if addr <> "" then repeat for tr_hist
      with frame c width 80 no-attr-space:

        /* SET EXTERNAL LABELS */
        setFrameLabels(frame c:handle).
        
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                 /*G345*/
      find prev tr_hist where tr_addr = addr  AND LOOKUP(tr_site,GLOBAL_user_site) > 0
    no-lock use-index tr_addr_eff.

/*N0WC*/ {&SOTRIQ04-P-TAG3}
      if (tr_type = "ISS-SO" or tr_type = "RCT-SOR" OR tr_type = "ISS-CSR" )       /*added by fdn*/
      and (tr_nbr = ord or ord = "" )
      and (tr_effdate = eff_date or eff_date = ?)
      then do:
/*N0WC*/ {&SOTRIQ04-P-TAG4}
     display tr_part tr_trnbr tr_date tr_effdate tr_ship_type
     tr_nbr format "x(8)" tr_rmks format "X(8)"
     (- tr_qty_loc) @ tr_qty_loc label {&sotriq04_p_1} WITH STREAM-IO /*GUI*/ .
      end.
   end.

   else if ord <> "" then
      repeat for tr_hist with frame d width 80 no-attr-space:

        /* SET EXTERNAL LABELS */
        setFrameLabels(frame d:handle).
        
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                 /*G345*/
      find prev tr_hist where tr_nbr = ord  AND LOOKUP(tr_site,GLOBAL_user_site) > 0
    no-lock use-index tr_nbr_eff.

/*N0WC*/ {&SOTRIQ04-P-TAG5}
      if tr_type = "ISS-SO" or tr_type = "RCT-SOR" OR tr_type = "ISS-CSR"          /*added by fdn*/
     and (tr_effdate = eff_date or eff_date = ?) then
/*N0WC*/ {&SOTRIQ04-P-TAG6}
      display tr_part tr_trnbr tr_date tr_effdate tr_ship_type
      tr_addr tr_rmks format "X(8)"
      (- tr_qty_loc) @ tr_qty_loc label {&sotriq04_p_1} WITH STREAM-IO /*GUI*/ .
   end.

   else if eff_date <> ? then
   repeat for tr_hist with frame f width 80 no-attr-space:

        /* SET EXTERNAL LABELS */
        setFrameLabels(frame f:handle).
        
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                 /*G345*/
      find prev tr_hist where tr_effdate = eff_date  AND LOOKUP(tr_site,GLOBAL_user_site) > 0 no-lock.

/*N0WC*/ {&SOTRIQ04-P-TAG7}
      if tr_type = "ISS-SO" or tr_type = "RCT-SOR" OR tr_type = "ISS-CSR"  then          /*added by fdn*/
/*N0WC*/ {&SOTRIQ04-P-TAG8}
      display tr_part tr_trnbr tr_date tr_ship_type
      tr_rmks format "X(8)" tr_nbr format "x(8)"
      (- tr_qty_loc) @ tr_qty_loc label {&sotriq04_p_1} WITH STREAM-IO /*GUI*/ .
   end.
   else repeat for tr_hist with frame e width 80 no-attr-space:

        /* SET EXTERNAL LABELS */
        setFrameLabels(frame e:handle).
        
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                 /*G345*/
/*N0WC*/ {&SOTRIQ04-P-TAG9}
      find prev tr_hist where ( tr_type = "ISS-SO" or tr_type = "RCT-SOR" OR tr_type = "ISS-CSR" )  AND LOOKUP(tr_site,GLOBAL_user_site) > 0 no-lock.         /*added by fdn*/
/*N0WC*/ {&SOTRIQ04-P-TAG10}

      display tr_part tr_trnbr tr_effdate tr_ship_type
      tr_addr tr_nbr format "x(8)"
      (- tr_qty_loc) @ tr_qty_loc label {&sotriq04_p_1} WITH STREAM-IO /*GUI*/ .
   end.

   {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

   {mfmsg.i 8 1}
end.
global_part = part.

/*K1JV*/ {wbrp04.i &frame-spec = a}
